<template>
  <div id="index-app">
    <!-- 侧边导航 -->
    <div class="sidebar">
      <div class="logo">
        <div class="logo-icon">P</div>
        <div class="logo-text">派派屋</div>
      </div>

      <div class="nav-menu">

        <a href="/paipaiwu/home" class="nav-item">
          <i class="fas fa-home"></i>
          <span>首页</span>
        </a>
        <a href="/paipaiwu/room" class="nav-item">
          <i class="fas fa-room"></i>
          <span>房间管理</span>
        </a>
        <a href="/paipaiwu/reservation" class="nav-item">
          <i class="fas fa-reservation"></i>
          <span>预约管理</span>
        </a>
        <a href="#" class="nav-item">
          <i class="fas fa-users"></i>
          <span>会员管理</span>
        </a>
        <a href="#" class="nav-item">
          <i class="fas fa-clipboard-list"></i>
          <span>订单管理</span>
        </a>
        <a href="#" class="nav-item">
          <i class="fas fa-chart-line"></i>
          <span>数据分析</span>
        </a>
        <a href="#" class="nav-item">
          <i class="fas fa-tags"></i>
          <span>活动营销</span>
        </a>
        <a href="#" class="nav-item">
          <i class="fas fa-cog"></i>
          <span>系统设置</span>
        </a>
      </div>

      <div class="user-panel">
        <div class="user-info">
          <div class="user-avatar">A</div>
          <div>
            <div class="user-name">管理员</div>
            <div class="user-role">超级管理员</div>
          </div>
        </div>
      </div>
    </div>

    <!-- 主内容区 -->

  </div>
</template>

<script>
export default {
  name: "PaiPaiWu",
  data() {
    return {
      activeNav: 'home' // 默认激活首页
    };
  },
  methods: {
    goTarget(href) {
      window.location.href = href;
    }

  }
};
</script>

<style >

:root {
  --primary-100: #8B5FBF;
  --primary-200: #61398F;
  --primary-300: #FFFFFF;
  --accent-100: #D6C6E1;
  --accent-200: #9A73B5;
  --text-100: #4A4A4A;
  --text-200: #878787;
  --bg-100: #F5F3F7;
  --bg-200: #E9E4ED;
  --bg-300: #FFFFFF;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
  background-color: var(--bg-100);
  color: var(--text-100);
  min-height: 100vh;
  display: flex;
}

/* 侧边导航 */
.sidebar {
  width: 260px;
  background-color: var(--bg-300);
  padding: 20px 0;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.logo {
  padding: 0 20px 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--bg-200);
  margin-bottom: 20px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-300);
  margin-right: 10px;
  font-weight: 600;
}

.logo-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-200);
}

.nav-menu {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text-100);
  text-decoration: none;
  background: var(--bg-300);
}

.nav-item:hover {
  background-color: var(--bg-200);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(139, 95, 191, 0.1), transparent);
  border-left: 3px solid var(--primary-100);
  color: var(--primary-200);
}

.nav-item i {
  margin-right: 12px;
  font-size: 18px;
  width: 24px;
  text-align: center;
  color: var(--primary-100);
}

.nav-item span {
  font-size: 14px;
  font-weight: 500;
}

.user-panel {
  padding: 20px;
  border-top: 1px solid var(--bg-200);
}

.user-info {
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-300);
  font-weight: 500;
  margin-right: 12px;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-100);
}

.user-role {
  font-size: 12px;
  color: var(--accent-200);
  margin-top: 2px;
}

/* 主内容区 */
/* 在组件的 <style scoped> 中添加 */
.main-content {
  position: absolute;
  top: 0; /* 强制贴顶 */
  left: 260px; /* 等于导航栏宽度 */
  width: calc(100% - 260px);
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  background: white;
  z-index: 10; /* 确保在导航栏上方 */
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary-200);
}

.search-bar {
  position: relative;
  width: 300px;
}

.search-bar input {
  width: 100%;
  padding: 10px 15px 10px 40px;
  border-radius: 8px;
  border: 1px solid var(--bg-200);
  background-color: var(--bg-300);
  color: var(--text-100);
  font-size: 14px;
}

.search-bar i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-200);
}

/* 数据卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-300);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--bg-200);
}

.stat-card:after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(139, 95, 191, 0.1), transparent);
  border-radius: 0 0 0 100%;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-300);
  margin-bottom: 15px;
}

.stat-title {
  font-size: 14px;
  color: var(--text-200);
  margin-bottom: 5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--primary-200);
}

.stat-change.positive {
  color: #8B5FBF;
  font-size: 12px;
  display: flex;
  align-items: center;
}

.stat-change.negative {
  color: #D63031;
  font-size: 12px;
  display: flex;
  align-items: center;
}

/* 主要内容区 */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  flex: 1;
}



.card-actions button {
  background: var(--primary-100);
  border: none;
  color: var(--primary-300);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.card-actions button:hover {
  background: var(--primary-200);
}

/* 表格样式 */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-200);
  border-bottom: 2px solid var(--bg-200);
}

.table td {
  padding: 12px 15px;
  font-size: 14px;
  border-bottom: 1px solid var(--bg-200);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background-color: var(--bg-200);
}



/* 响应式设计 */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .nav-menu {
    display: flex;
    overflow-x: auto;
    padding: 10px;
  }

  .nav-item {
    flex-shrink: 0;
    margin-bottom: 0;
    margin-right: 10px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-bar {
    width: 100%;
    margin-top: 15px;
  }
}
</style>
